﻿@model WebEntities.Models.WebInfo.LeaveMsg

@{
    ViewBag.Title = "网站管理平台_查看用户留言";
}

@section HeadContent
{
    <script src="/Scripts/LeaveMsg/editmsg.js" type="text/javascript"></script>
}

@(Html.X().Viewport()
    .Layout("fit")
    .Items(
        Html.X().TabPanel()
            .Layout(LayoutType.Fit)
            .Items(
                Html.X().FormPanel()
                    .ID("FormPanel1")
                    .Title("留言信息")
                    .Layout("fit")
                    .Items(
                        Html.X().Panel().BodyStyle("background-color:white;").Border(false).Layout(LayoutType.Border).Items(
                            Html.X().Panel().Border(false).Layout("Column").Region(Region.North).Items(
                                Html.X().Panel()
                                    .Border(false)
                                    .ColumnWidth(0.5)
                                    .Padding(5)
                                    .Layout("form")
                                    .Defaults(
                                        Html.X().Parameter().Name("AnchorHorizontal").Value("90%")
                                    )
                                    .Items(
                                        Html.X().HiddenFor(m => m.MsgID).ID("MsgID1").Name("MsgID"),
                                        Html.X().TextFieldFor(m => m.TypeName).ID("TypeName").FieldLabel("留言类别").ReadOnly(true),
                                        Html.X().TextFieldFor(m => m.NeedContact).ID("NeedContact").FieldLabel("是否需要联系").ReadOnly(true),
                                        Html.X().TextFieldFor(m => m.Mobile).ID("Mobile").FieldLabel("联系电话").ReadOnly(true),
                                        Html.X().TextFieldFor(m => m.QQNum).ID("QQNum").FieldLabel("QQ").ReadOnly(true),
                                        Html.X().TextField().ID("IsReply").FieldLabel("回复留言").Text((string)ViewBag.IsReplyTxt).ReadOnly(true)
                                    ),
                                Html.X().Panel()
                                    .Border(false)
                                    .ColumnWidth(0.5)
                                    .Padding(5)
                                    .Layout("form")
                                    .Defaults(
                                        Html.X().Parameter().Name("AnchorHorizontal").Value("90%")
                                    )
                                    .Items(
                                        Html.X().TextFieldFor(m => m.MsgSubject).ID("MsgSubject").FieldLabel("标题").ReadOnly(true),
                                        Html.X().TextFieldFor(m => m.ContactMan).ID("ContactMan").FieldLabel("联系人").ReadOnly(true),
                                        Html.X().TextFieldFor(m => m.Email).ID("Email").FieldLabel("电子邮件").ReadOnly(true),
                                        Html.X().DateFieldFor(m => m.CreateTime).ID("CreateTime").FieldLabel("提交时间").ReadOnly(true),
                                        Html.X().TextField().ID("IsPublic").FieldLabel("审核状态").Text((string)ViewBag.IsPublicTxt).ReadOnly(true)

                                    )
                            )
                            .TopBar(
                                Html.X().Toolbar().Items(
                                    Html.X().Button().Text("审核留言").Icon(Icon.ScriptEdit)
                                        .Menu(
                                            Html.X().Menu().Items(
                                                Html.X().MenuItem().Text("审核通过").Icon(Icon.ScriptStart)
                                                    .DirectEvents(de =>
                                                    {
                                                        de.Click.Action = "AuditLeaveMsg";
                                                        de.Click.ExtraParams.Add(new Parameter("msgId", Model.MsgID.ToString()));
                                                        de.Click.ExtraParams.Add(new Parameter("isPub", "true"));
                                                        de.Click.EventMask.ShowMask = true;
                                                        de.Click.EventMask.Msg = "正在提交审核结果";
                                                        de.Click.Success = "ext.net.comjs.onSubmitSuccess";
                                                        de.Click.Failure = "ext.net.comjs.onSubmitFailure";
                                                    }),
                                                Html.X().MenuItem().Text("审核不通过").Icon(Icon.ScriptStop)
                                                    .DirectEvents(de =>
                                                    {
                                                        de.Click.Action = "AuditLeaveMsg";
                                                        de.Click.ExtraParams.Add(new Parameter("msgId", Model.MsgID.ToString()));
                                                        de.Click.ExtraParams.Add(new Parameter("isPub", "false"));
                                                        de.Click.EventMask.ShowMask = true;
                                                        de.Click.EventMask.Msg = "正在提交审核结果";
                                                        de.Click.Success = "ext.net.comjs.onSubmitSuccess";
                                                        de.Click.Failure = "ext.net.comjs.onSubmitFailure";
                                                    })
                                            )
                                        )
                                )
                            ),
                            Html.X().Panel().Border(false).Layout("fit").Region(Region.Center).PaddingSpec("0 5 5 5").Items(
                                Html.X().TextAreaFor(m => m.MsgBody).FieldLabel("留言内容").AnchorHorizontal("90%").ReadOnly(true)
                            )
                        )
                    ),
                Html.X().FormPanel().Title("回复留言").Layout("fit")
                    .Items(
                        Html.X().Panel().Border(false).Padding(5).Layout("form")
                            .Defaults(Html.X().Parameter().Name("AnchorHorizontal").Value("90%"))
                            .Items(
                                Html.X().HiddenFor(m => m.MsgID).ID("MsgID2").Name("MsgID"),
                                Html.X().TextField().ID("ReplyMan").FieldLabel("回复人").Text(ViewBag.ReplyMan),
                                Html.X().TextArea().ID("ReplyContent").FieldLabel("回复内容").Grow(true).GrowMax(350).Text(ViewBag.ReplyContent)
                            )
                    )
                    .TopBar(
                        Html.X().Toolbar()
                            .Items(Html.X().Button().Text("保存").Icon(Icon.Disk)
                                .DirectEvents(de =>
                                {
                                    de.Click.Url = Url.Action("SaveReplyMsg", "ReplyMsg");
                                    de.Click.EventMask.ShowMask = true;
                                    de.Click.EventMask.Msg = "正在保存";
                                    de.Click.Success = "onSubmitReplySuccess";
                                    de.Click.Failure = "ext.net.comjs.onSubmitFailure";
                                })
                            )
                    )
            )
    )
)